import 'package:flutter_screenutil/screenutil.dart';
import 'package:flutter/material.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/NavigationBar.dart';
import 'package:heyangkuaidai/FrameWorkModule/Utils/SPUtils.dart';
import 'package:heyangkuaidai/DemonStrateModule/LoanLimitCheckFinshPage.dart';
import 'package:heyangkuaidai/DemonStrateModule/LoanCertificationPage.dart';
import 'package:heyangkuaidai/DemonStrateModule/LoanSubscribePage.dart';
class LoanFirstPage extends StatefulWidget {
  @override
  _FirstPageState createState() => _FirstPageState();
}

class _FirstPageState extends State<LoanFirstPage> {

  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, width: 375, height: 667, allowFontScaling: true);
    return Scaffold(
        resizeToAvoidBottomInset: false,
        body:Column(
          children: [
            SizedBox(height: MediaQuery.of(context).padding.top,),
            NavigationBar(false,title: "福祥e贷",),
            Container(
              height: ScreenUtil().setWidth(30),
              color: Color(0xffF6FBFF),
              child: Row(
                children: [
                  SizedBox(width:ScreenUtil().setWidth(18),),
                  Container(
                    child:Text("请注意，福祥e贷无任何中介费用。",style: TextStyle(fontSize: ScreenUtil().setSp(14),color:Color(0xff2C85BF)),textAlign: TextAlign.left,),
                  ),
                  SizedBox(width:ScreenUtil().setWidth(80),),
                  Image.asset("sources/x.png",width: ScreenUtil().setWidth(14.6),height: ScreenUtil().setWidth(14.6),),
                ],
              ),
            ),
            Container(
              color:Colors.blue, 
              child: Image.asset("sources/yy/enterBaner.png"),
              height:ScreenUtil().setWidth(184) ,
            ),
            SizedBox(
              height:ScreenUtil().setWidth(18) ,
            ),
            InkWell(
              onTap: (){
                // SPUtils.removeData("status");
                SPUtils.get("status").then((value) {
                  if(value =="Yes") {
                     Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) => new LoanLimitCheckFinshPage(),
                  ),
                );
                  }else{
                     Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) => new LoanCertificationPage(),
                  ),
                );
                  }
                });
              },
              child: Container(
                    color:Colors.white,
                    width: ScreenUtil.screenWidth-ScreenUtil().setWidth(30),
                    height: ScreenUtil().setWidth(90),
                    child: Row(
                      children: [
                        SizedBox(width:ScreenUtil().setWidth(22) ,),
                        Column(
                          children: [
                            SizedBox(height: ScreenUtil().setWidth(14),),
                            Container(
                              width: ScreenUtil().setWidth(150),
                              child:Text("快贷",style: TextStyle(fontSize: ScreenUtil().setSp(17),),textAlign: TextAlign.left,),
                            ),
                            SizedBox(height: ScreenUtil().setWidth(7),),
                            Container(
                              width: ScreenUtil().setWidth(150),
                              child: Text("快速申请，急速放款",style: TextStyle(fontSize: ScreenUtil().setSp(13), ),textAlign: TextAlign.left),
                            ),
                          ],
                        ),
                        SizedBox(width:ScreenUtil().setWidth(80) ,),
                        Image.asset("sources/yy/loanIcon.png",width: ScreenUtil().setWidth(71),height: ScreenUtil().setWidth(60),),
                      ],
                    ),

              ) ,
            ),
            SizedBox(height: ScreenUtil().setWidth(80),),
            Row(
              children: [
                 SizedBox(width:ScreenUtil.screenWidth - ScreenUtil().setWidth(90),),
                 InkWell(
                   onTap: (){

                      Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) => new LoanSubscribePage(),
                  ),
                );
                   },
                  child:Container(
                    child: Image.asset("sources/yy/subscribe.png"),
                    width: ScreenUtil().setWidth(90),
                    height: ScreenUtil().setWidth(90),
                  ),
                )
              ],
            )
           
          ],
        )

    );

  }
}


